package com.biubiushop.util;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.biubiushop.constant.ALiInfoConstant;

/**
 * 使用单例模式获取唯一实例
 * Created by chenjia on 2019-06-06
 *
 */
public class ALiPayUtil {
	
	private static class SingletonInstance{
		private static final AlipayClient INSTANCE = new DefaultAlipayClient(ALiInfoConstant.URL, ALiInfoConstant.APP_ID, ALiInfoConstant.APP_PRIVATE_KEY, ALiInfoConstant.FORMAT,
				ALiInfoConstant.CHARSET, ALiInfoConstant.ALIPAY_PUBLIC_KEY, ALiInfoConstant.SIGN_TYPE);
	}
	
	public static AlipayClient getInstance() {
	      return SingletonInstance.INSTANCE;
	}
}
